import Vue from "vue";
import VueRouter from "vue-router";
Vue.use(VueRouter);

const home = () => import("@/view/home.vue");
const info1 = () => import("@/view/info1.vue");
const info2 = () => import("@/view/info2.vue");
const mine = () => import("@/view/mine.vue");
const learn = () => import("@/view/learn.vue");

const routes = [
  {
    path: "/",
    name: "home",
    component: home,
    meta: "首页"
  },
  {
    path: "/info1",
    name: "info1",
    component: info1,
    meta: "详情1",
  },
  {
    path: "/info2",
    name: "info2",
    component: info2,
    meta: "详情2",
  },
  {
    path: "/mine",
    name: "mine",
    component: mine,
    meta: "我的",
  },
  {
    path: "/learn",
    name: "learn",
    component: learn,
    meta: "learn",
  }
];

const router = new VueRouter({
  routes,
});

export default router;
